window.onload = function() {
	var boxs = [];
	var i = 0;
	var el;
	for ( i = 0; i != 1000; ++i ) {
		el = document.createElement( "div" );
		el.style.setProperty( "height", "1px", "" );
		el.style.setProperty( "width", "200px", "" );
		el.style.setProperty( "background-color", "red", "" );
		el.style.setProperty( "position", "absolute", "" );
		el.dddddd = i;
		document.body.appendChild( el );
		boxs.push( el );
	}

	// 调整盒子的位置
	function fitBox() {
		var i = 0;
		var curHeight = 0; // 当前的高度
		for ( i = 0; i != 1000; ++i ) {
			el = boxs[i];
			curHeight = curHeight + parseInt(el.style.getPropertyValue( "height" )); // 更新目前的高度
			el.style.setProperty( "height", curHeight + "px", "" );
		}
	}
	fitBox();
};
